#include "GeoTiffImage.hxx"
#include "GeoTiffReader.hxx"
#include "GeoTiffWriter.hxx"

int main()
{
    printf("=============Test Read GeoImage============\n");
    GeoTiffImage image;

    GeoTiffReader reader;

    reader.setGeoTiffFileName("/home/hzy/XXH20190820A1DEM.TIFF");
    reader.setGeoTiffImage(&image);
    reader.readImage();

    printf("Image Width:%d\n", image.getWidth());
    printf("Image Height:%d\n", image.getHeight());
    printf("Image Channels:%d\n", image.getChannels());
    printf("Image Depth:%d\n", image.getDepth());
    printf("Image Min Value:%f\n", image.getMinValue());
    printf("Image Max Value:%f\n", image.getMaxValue());

    printf("=============Test Write GeoImage===========\n");

    GeoTiffWriter writer;
    writer.setFileName("/home/hzy/WriterTest.TIFF");
    writer.setGeoTiffImage(&image);
    writer.write();

    printf("=============Test Resize GeoImage==========\n");
    GeoTiffImage resizedImage;

    image.resizeTo(&resizedImage, image.getWidth() * 2, image.getHeight()*2 );
    writer.setFileName("/home/hzy/ResizeTest.TIFF");
    writer.setGeoTiffImage(&resizedImage);
    writer.write();

    printf("=============Resize Test Finished=========\n");

    return 0;
}